Conditions | 2 |
Paths | 1 |
Total Lines | 10 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import { setBlockType } from 'prosemirror-commands'; |
||
21 | getMenuItem(schema) { |
||
22 | if (!this.isAvailable(schema)) { |
||
23 | throw new Error('Headings not available in this schema!'); |
||
24 | } |
||
25 | return new MenuItem({ |
||
26 | command: setBlockType(schema.nodes.heading, { level: this.level }), |
||
27 | icon: svgIcon(`format-header-${this.level}`), |
||
28 | label: `Heading ${this.level}`, |
||
29 | }); |
||
30 | } |
||
31 | } |
||
32 |